// ActionScript file


 import mx.collections.ArrayCollection;
 import mx.controls.Alert;
 
 import spark.components.ComboBox;
 
 
  public function selectComboBox(comboBox: spark.components.ComboBox, id: String , a:String): void   
 {          	
            var dataProvider:ArrayCollection = ArrayCollection(comboBox.dataProvider);  
            var selectedIndex: int = 0;  
              
            for (var i:int = 0; i < dataProvider.length; i++) {  
                if (dataProvider[i].a == id) { 
                    selectedIndex = i;  
                }  
            }  
            comboBox.selectedIndex = i;  
            
        	
 }
        
   public function selectComboBoxString(comboBox: spark.components.ComboBox, id: int): void   
        {  
            var dataProvider:ArrayCollection = ArrayCollection(comboBox.dataProvider);  
            var selectedIndex: int = 0;  
              
            for (var i:int = 0; i < dataProvider.length; i++) {  
                if (dataProvider[i].id == id) {  
                    selectedIndex = i;  
                    break;  
                }  
            }  
            comboBox.selectedIndex = i;  
        }      